//必须带done回调 执行完成调用
export default function print({ vm, action, callbackData, additionalData, done }) {
  console.log('ops=====0', additionalData.data.value)
  let printId = action.extension.printSelect.value && action.extension.printSelect.value[0]
  if (printId) {
    let _print = vm.vuiComponents[`${printId}`]
    console.log('ops=====', _print)
    if (_print) {
      let ops = _print.self.getInfo.extension.dropdownOption.value
      if (ops.length == 0) {
        console.log('请配置打印参数')
        return
      }
      console.log('ops=====1', additionalData, callbackData)
      _print.self.$handlePrint({
        data: additionalData.data.value ? additionalData.data : ops[0],
        table: callbackData,
      })
    } else {
      console.log('没有找到打印组件')
    }
  } else {
    console.log('没有在交互配置选择打印组件')
  }
  done(null, {})
}
